<?php
namespace Admin\Controller;
use Think\Controller;
class AppController extends BaseController {
	
    public function index(){
            
            $admin=M();
            $content=I('get.content');
            //$msg=explode('/', $content);
            $app_admin=$admin->table('sdk_user U')->join(' sdk_app A ON U.id=A.user_id')->where("app_name='".$content."'OR app_id='".$content."'OR username='".$content."'")->select();
            if(!$app_admin){
                //echo "<script>alert('无符合条目');</script>";
                $app_admin=$admin->table('sdk_user U')->join(' sdk_app A ON U.id=A.user_id')->select();
            }
            //$app_admin=$admin->table('sdk_user U')->join(' sdk_app A ON U.id=A.user_id')->select();
           

            $this->assign('app_admin',$app_admin);
            $this->display();
        
        
    }
   
    public function delete_cp(){
        $id=I('post.id');
        $admin=M();
        $result=$admin->table('sdk_app')->where("id='".$id."'")->delete(); 
        
        if($result){
            echo "删除成功";
        }else{
            echo "删除失败";
        }

    }
     
    
}
   
